import { toHandlerKey, camelize } from '@/shared'

export const emit = (instance, event, ...args) => {
  console.log('event', event)
  const { props } = instance

  const handlerName = toHandlerKey(event)
  const handler = props[camelize(handlerName)]
  handler && handler(...args)
}
